package com.gopay.common.domain.gsrt;
// Generated 2016-1-16 17:20:08 by Hibernate Tools 4.3.1.Final

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * Entity: 发标
 */
@Entity
@Table(name = "GSRT_CUST_TENDER_MASTER")
public class GsrtCustTenderMaster implements java.io.Serializable {
    
    /**
     * 
     * @Description: 标的状态   01：募集中、02：还款中、03：已结束
     * @author hougn
     * @date 2016年3月21日 上午10:19:00 
     *
     */
    public enum BidState {
        RAISE("01", "募集中"), REPAYMENT("02", "还款中"),END("03", "已结束");

        private String code;
        private String name;

        private BidState(String code, String name) {
            this.name = name;
            this.code = code;
        }

        public String getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        public static String getNameByCode(String code) {
            if (code == null) {
                return null;
            }
            for (BidState flag : BidState.values()) {
                if (flag.getCode().equals(code)) {
                    return flag.name;
                }
            }
            return null;
        }
    }
    
    

    
    /**
     * 
     * @Description: 是否有担保方 01有  02 没有
     * @author hougn
     * @date 2016年3月22日 下午2:32:28 
     *
     */
    public enum IsTenderSurety {
        YES("01", "有"), NO("02", "没有");

        private String code;
        private String name;

        private IsTenderSurety(String code, String name) {
            this.name = name;
            this.code = code;
        }

        public String getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        public static String getNameByCode(String code) {
            if (code == null) {
                return null;
            }
            for (IsTenderSurety flag : IsTenderSurety.values()) {
                if (flag.getCode().equals(code)) {
                    return flag.name;
                }
            }
            return null;
        }
    }
    
	/** 
     * 网关交易流水号
     */
    private Long transDtlSq;
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/** 
     * 发标ID
     */
    private Long id;

    /** 
     * 商户订单号
     */
    private String merOrderId;

    /** 
     * 商户id
     */
    private String merCustId;

    /** 
     * 提交时间
     */
    private Date merTxnTm;

    /** 
     * 商户交易时间
     */
    private Date gopayTxnTm;

    /** 
     * 国付宝订单号
     */
    private String gopayOrderId;

    /** 
     * 标的号
     */
    private String bidNo;

    /** 
     * 标的名称
     */
    private String bidName;

    /** 
     * 标的金额
     */
    private BigDecimal merTxnAmt;

    /** 
     * 标的状态   01：募集中、02：还款中、03：已结束
     */
    private String bidState;

    /** 
     * 标的产品类型      ------01：散标 02：众筹
     */
    private String bidType;

    /** 
     * 利率（年化）
     */
    private BigDecimal interest;

    /** 
     * 借款期限
     */
    private Long loanLife;

    /** 
     * 借款期限单位
     */
    private String loanLifeUnit;

    /** 
     * 还款日期
     */
    private Date repaymentDay;

    /** 
     * 还款方式    01：一次性还本付息、02：先息后本、03：等额本息、04：等额本金、05、众筹无还款 06:其他
     */
    private String repaymentType;

    /** 
     * 投标截止日期
     */
    private Date bidDeadline;

    /** 
     * 借款方协议号
     */
    private String borrowerConstracterId;

    /** 
     * 是否有担保方 01有  02 没有
     */
    private String isTenderSurety;

    /** 
     * 创建时间
     */
    private Date createdTs;
    /**
     *  废弃
     */
    private Date repaymentTs;
    /**
     *  废弃
     */
    private Date closeTs;

    /** 
     * 备注
     */
    private String remark;

    /** 
     * 预留字段3
     */
    private String remark3;

    /** 
     * 预留字段2
     */
    private String remark2;

    /** 
     * 交易原因
     */
    private String commentRk;

    /** 
     * 乐观锁版本号
     */
    private Long version;
    /**
     *   成功 20000  
     *   失败20001
     *   进行中 30000
     */
    private Integer txnStaCd;

    /** 
     * 记录最后修改时间
     */
    private Date lastUpdTs;
    /**
	 * 银行审核状态 恒丰银行(P-审核通过 R-审核拒绝 S-待审核 F-附件已上传） 银行审核状态
	 */
    private String bankState;
    /**
     *银行标的ID  （恒丰银行给的） 
     */
    private String bankBidNo;
    
    /** 
	 * 交易处理完成时间
	 */
    private Date tranFinishTime;

    public GsrtCustTenderMaster() {
    }


    @Id
    @SequenceGenerator(name = "GsrtCustTenderMasterSequence", sequenceName = "GSRT_CUST_TENDER_MASTER_SEQ")
    @GeneratedValue(generator = "GsrtCustTenderMasterSequence", strategy = GenerationType.SEQUENCE)
    @Column(name = "ID", unique = true, nullable = false, precision = 22, scale = 0)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "MER_ORDER_ID", nullable = false, length = 30)
    public String getMerOrderId() {
        return this.merOrderId;
    }

    public void setMerOrderId(String merOrderId) {
        this.merOrderId = merOrderId;
    }

    @Column(name = "MER_CUST_ID", nullable = false, length = 10)
    public String getMerCustId() {
        return this.merCustId;
    }

    public void setMerCustId(String merCustId) {
        this.merCustId = merCustId;
    }

    @Column(name = "MER_TXN_TM", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getMerTxnTm() {
        return this.merTxnTm;
    }

    public void setMerTxnTm(Date merTxnTm) {
        this.merTxnTm = merTxnTm;
    }

    @Column(name = "GOPAY_TXN_TM", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getGopayTxnTm() {
        return this.gopayTxnTm;
    }

    public void setGopayTxnTm(Date gopayTxnTm) {
        this.gopayTxnTm = gopayTxnTm;
    }

    @Column(name = "GOPAY_ORDER_ID", nullable = false, length = 30)
    public String getGopayOrderId() {
        return this.gopayOrderId;
    }

    public void setGopayOrderId(String gopayOrderId) {
        this.gopayOrderId = gopayOrderId;
    }

    @Column(name = "BID_NO", nullable = false, length = 50)
    public String getBidNo() {
        return this.bidNo;
    }

    public void setBidNo(String bidNo) {
        this.bidNo = bidNo;
    }

    @Column(name = "BID_NAME", nullable = false, length = 80)
    public String getBidName() {
        return this.bidName;
    }

    public void setBidName(String bidName) {
        this.bidName = bidName;
    }

    @Column(name = "MER_TXN_AMT", nullable = false, precision = 20)
    public BigDecimal getMerTxnAmt() {
        return this.merTxnAmt;
    }

    public void setMerTxnAmt(BigDecimal merTxnAmt) {
        this.merTxnAmt = merTxnAmt;
    }

    @Column(name = "BID_STATE", nullable = false, length = 4)
    public String getBidState() {
        return this.bidState;
    }

    public void setBidState(String bidState) {
        this.bidState = bidState;
    }

    @Column(name = "BID_TYPE", nullable = false, length = 4)
    public String getBidType() {
        return this.bidType;
    }

    public void setBidType(String bidType) {
        this.bidType = bidType;
    }

    @Column(name = "INTEREST", precision = 20)
    public BigDecimal getInterest() {
        return this.interest;
    }

    public void setInterest(BigDecimal interest) {
        this.interest = interest;
    }

    @Column(name = "LOAN_LIFE", precision = 22, scale = 0)
    public Long getLoanLife() {
        return this.loanLife;
    }

    public void setLoanLife(Long loanLife) {
        this.loanLife = loanLife;
    }

    @Column(name = "LOAN_LIFE_UNIT")
    public String getLoanLifeUnit() {
		return loanLifeUnit;
	}

	public void setLoanLifeUnit(String loanLifeUnit) {
		this.loanLifeUnit = loanLifeUnit;
	}
    
    
    @Column(name = "REPAYMENT_DAY")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getRepaymentDay() {
        return this.repaymentDay;
    }

	public void setRepaymentDay(Date repaymentDay) {
        this.repaymentDay = repaymentDay;
    }

    @Column(name = "REPAYMENT_TYPE", length = 4)
    public String getRepaymentType() {
        return this.repaymentType;
    }

    public void setRepaymentType(String repaymentType) {
        this.repaymentType = repaymentType;
    }

    @Column(name = "BID_DEADLINE")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getBidDeadline() {
        return this.bidDeadline;
    }

    public void setBidDeadline(Date bidDeadline) {
        this.bidDeadline = bidDeadline;
    }

    @Column(name = "BORROWER_CONSTRACTER_ID", nullable = false, length = 14)
    public String getBorrowerConstracterId() {
        return this.borrowerConstracterId;
    }

    public void setBorrowerConstracterId(String borrowerConstracterId) {
        this.borrowerConstracterId = borrowerConstracterId;
    }

    @Column(name = "IS_TENDER_SURETY", nullable = false, length = 4)
    public String getIsTenderSurety() {
        return this.isTenderSurety;
    }

    public void setIsTenderSurety(String isTenderSurety) {
        this.isTenderSurety = isTenderSurety;
    }

    @Column(name = "CREATED_TS", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreatedTs() {
        return this.createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Column(name = "REPAYMENT_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getRepaymentTs() {
        return this.repaymentTs;
    }

    public void setRepaymentTs(Date repaymentTs) {
        this.repaymentTs = repaymentTs;
    }

    @Column(name = "CLOSE_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCloseTs() {
        return this.closeTs;
    }

    public void setCloseTs(Date closeTs) {
        this.closeTs = closeTs;
    }

    @Column(name = "REMARK", length = 90)
    public String getRemark() {
        return this.remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Column(name = "REMARK3", length = 50)
    public String getRemark3() {
        return this.remark3;
    }

    public void setRemark3(String remark3) {
        this.remark3 = remark3;
    }

    @Column(name = "REMARK2", length = 50)
    public String getRemark2() {
        return this.remark2;
    }

    public void setRemark2(String remark2) {
        this.remark2 = remark2;
    }

    @Column(name = "COMMENT_RK", length = 50)
    public String getCommentRk() {
        return this.commentRk;
    }

    public void setCommentRk(String commentRk) {
        this.commentRk = commentRk;
    }

    @Column(name = "VERSION", precision = 22, scale = 0)
    @Version
    public Long getVersion() {
        return this.version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    @Column(name = "LAST_UPD_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastUpdTs() {
        return this.lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }
	@Column(name = "TRANS_DTL_SQ", precision = 22, scale = 0)
	public Long getTransDtlSq() {
		return transDtlSq;
	}
	
    @Column(name = "TXN_STA_CD", nullable = false, precision = 5, scale = 0)
    public Integer getTxnStaCd() {
        return this.txnStaCd;
    }
   
    

    @Column(name = "BANK_STATE", precision = 2, scale = 0)
    public String getBankState() {
		return bankState;
	}


	public void setBankState(String bankState) {
		this.bankState = bankState;
	}
    public void setTxnStaCd(Integer txnStaCd) {
        this.txnStaCd = txnStaCd;
    }
	public void setTransDtlSq(Long transDtlSq) {
		this.transDtlSq = transDtlSq;
	}

	@Column(name = "BANK_BID_NO", precision = 90, scale = 0)
	public String getBankBidNo() {
		return bankBidNo;
	}


	public void setBankBidNo(String bankBidNo) {
		this.bankBidNo = bankBidNo;
	}
	
	@Column(name = "TRAN_FINISH_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getTranFinishTime() {
		return this.tranFinishTime;
	}

	public void setTranFinishTime(Date tranFinishTime) {
		this.tranFinishTime = tranFinishTime;
	}
}
